import {
    Form, Select, InputNumber, Switch, Radio,
    Slider, Button, Upload, Icon, Rate, Checkbox,
    Row, Col,Input
  } from 'antd';

const { Option } = Select;

class FormProduct extends React.Component {
handleSubmit = (e) => {
  e.preventDefault();
  this.props.form.validateFields((err, values) => {
    if (!err) {
      console.log('Received values of form: ', values);
    }
  });
}

normFile = (e) => {
  console.log('Upload event:', e);
  if (Array.isArray(e)) {
    return e;
  }
  return e && e.fileList;
}

render() {
  const { getFieldDecorator } = this.props.form;
  const formItemLayout = {
    labelCol: { span: 6 },
    wrapperCol: { span: 14 },
  };
  return (
    <Form onSubmit={this.handleSubmit}>
      <Form.Item
        {...formItemLayout}
        label="总库存"
      >
        {getFieldDecorator('totalInventory', { initialValue: 3 })(
          <InputNumber min={1} max={10} />
        )}
        <span className="ant-form-text">/个</span>
      </Form.Item>
    </Form>
  );
}
}

const FormProductWrap = Form.create({})(FormProduct);
export default FormProductWrap;